package com.ziyun.pop.common.pay;

import io.swagger.annotations.ApiModel;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;

/**
 * 支付记录
 * 
 * @author lj
 *
 * @date 2017年11月7日
 */
@Getter
@Setter
@ApiModel("支付流水记录")
public class UserPaymentLogDto {

	private String paymentId;

	private String weixinOpenid;

	private BigDecimal money;

	/** 支付方式 */
	private PayType payWay;

	/** 支付类型 */
	private PayUse payUse;

	private String tradeNo;

	/** 订单号或用户id */
	private String relId;

	private Integer offlineType;

	private PayStatus payStatus;

	public static UserPaymentLogDto valueOf(String paymentId, BigDecimal money, PayType payWay, PayUse payUse,
			String tradeNo, String relId, Integer offlineType) {
		UserPaymentLogDto paymentLogDto = new UserPaymentLogDto();
		paymentLogDto.paymentId = paymentId;
		paymentLogDto.money = money;
		paymentLogDto.payWay = payWay;
		paymentLogDto.payUse = payUse;
		paymentLogDto.tradeNo = tradeNo;
		paymentLogDto.relId = relId;
		paymentLogDto.offlineType = offlineType;
		paymentLogDto.payStatus = PayStatus.ready;
		return paymentLogDto;
	}

	public static UserPaymentLogDto valueOfPayCallback(String paymentId, BigDecimal money, PayType payWay,
			PayUse payUse, String tradeNo, String relId, PayStatus payStatus) {
		UserPaymentLogDto paymentLogDto = new UserPaymentLogDto();
		paymentLogDto.paymentId = paymentId;
		paymentLogDto.money = money;
		paymentLogDto.payWay = payWay;
		paymentLogDto.payUse = payUse;
		paymentLogDto.tradeNo = tradeNo;
		paymentLogDto.relId = relId;
		paymentLogDto.payStatus = payStatus;
		return paymentLogDto;
	}

}
